using System;

namespace Framework
{
    public static class Log
    {
        private static Framework.Debugger.DebuggerManager s_DebuggerManager = null;

        public static void Info(string format, params object[] args)
        {
            CheckCachedDebuggerManager();
            s_DebuggerManager.Info(format, args);
        }

        public static void Error(string format, params object[] args)
        {
            CheckCachedDebuggerManager();
            s_DebuggerManager.Error(format, args);
        }

        public static void Error(Exception e)
        {
            CheckCachedDebuggerManager();
            s_DebuggerManager.Error(e);
        }

        private static void CheckCachedDebuggerManager()
        {
            if (s_DebuggerManager == null)
            {
                s_DebuggerManager = FrameworkEntry.GetModule<Framework.Debugger.DebuggerManager>();
            }
        }
    }
}